package Mediator;

public abstract class Member {
    protected AbstractChatroom chatroom;
    protected String name;

    public Member(String name)
    {
        this.name = name;
    }

    public String getName()
    {
        return name;
    }

    public void setName()
    {
        this.name = name;
    }

    public AbstractChatroom getChatroom()
    {
        return chatroom;
    }

    public void setChatroom(AbstractChatroom chatroom)
    {
        this.chatroom = chatroom;
    }

    public abstract void sendText(String to,String text);
    public abstract void sendImage(String to,String img);

    public void receiveText(String from, String text)
    {
        System.out.println(from + "发送文本给" + name);
        System.out.println("内容:" + text);
    }

    public void receiveImage(String from, String img)
    {
        System.out.println(from + "发送图片给" + name);
        System.out.println("内容:" + img);
    }

}
